package com.example.g3a1.login

import androidx.lifecycle.MutableLiveData
import com.example.base.cons.ApiServer
import com.example.base.cons.entity.LoginEntity
import com.example.base.cons.mvvm.BaseViewModel
import dagger.hilt.android.AndroidEntryPoint
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

@HiltViewModel
class LoginViewModel @Inject constructor(val apiServer:ApiServer) : BaseViewModel() {
    val loginData = MutableLiveData<LoginEntity>()

    fun login(username:String,password:String){
        httpReq({apiServer.login(username,password)}, loginData::postValue)
    }
}